#include "tmatrix.h"
#include "tools.h"

/* ---------- FWAVE ----------------*/

class Fwave {

 public:

  Complex A;
  Complex B;
  Complex kv;
  double mass;
  Fwave * ptr;

  Fwave();
  ~Fwave();
  Fwave(Fwave & );
  Fwave(Complex A_inp,Complex B_inp,Complex kv_inp,double mass_inp);
  Fwave operator=(const Fwave & wave);
  void is(Complex A_inp,Complex B_inp,Complex kv_inp,double mass_inp);
  Complex eval(double x);
  void show();

};
/* ---------- EIGENVALUE ----------------*/

class Eigenvalue {

 public:

  double energy;
  double sigma;
  double gamma;
  Eigenvalue * ptr;

  Eigenvalue() { energy = 0; sigma = 0; gamma = 0; ptr =0; }
  Eigenvalue(Eigenvalue & op) { energy = op.energy; sigma = op.sigma; gamma = op.gamma; ptr = 0;}
  Eigenvalue(double op1,double op2 ,double op3) { energy = op1; sigma = op2; gamma = op3; ptr = 0; }
  ~Eigenvalue() {
    Eigenvalue * cr;
    while(ptr) {
      cr = ptr;
      while(cr->ptr!=0) cr = cr->ptr;
      delete cr;
    }
  }
  Eigenvalue operator=(const Eigenvalue & op) {
    energy = op.energy; sigma = op.sigma; gamma = op.gamma; ptr = 0;
    return * this;
  }
  Eigenvalue is(double op1,double op2 ,double op3) {
    energy = op1; sigma = op2; gamma = op3; ptr = 0;
    return * this;
  }
  void show() {
    printf("Energy=%le  sigma=%le  gamma=%le\n",energy, sigma, gamma);
  }


};



/* ---------- STEP ----------------*/

class Step {

 public:

  int		left[2];
  int		right[2];
  double 	energy;
  double 	size;
  double 	mass;
  Step * 	ptr;

  Step() { left[0] = 0; left[1] = 0; energy = 0; size = 0; mass = 0; ptr = 0; }
  Step(int,int,double,double,double);
  ~Step() { 
    Step * tmp;
    while(ptr!=0) {
      tmp = ptr;
      while(tmp->ptr!=0) tmp=tmp->ptr;
      delete tmp;
    }
  }
  Step operator=(const Step &);
  Step is(int,int,double,double,double);
  void show(){printf("E=%le, Size=%le, mass=%le,in (%d,%d)--(%d,%d)",
		     energy,size,mass,left[0],left[1],right[0],right[1]);}


};


Eigenvalue *  lorenzian( int num_y, double y[], double x[], int & num, int tail_inp ,int Number_of_peaks_requested);













